home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / LINUX / LINKAGE.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  1KB  |  55 lines

  1. #ifndef _LINUX_LINKAGE_H
  2. #define _LINUX_LINKAGE_H
  3.  
  4. #ifdef __cplusplus
  5. #define CPP_ASMLINKAGE extern "C"
  6. #else
  7. #define CPP_ASMLINKAGE
  8. #endif
  9.  
  10. #if defined __i386__ && (__GNUC__ > 2 || __GNUC_MINOR__ > 7)
  11. #define asmlinkage CPP_ASMLINKAGE __attribute__((regparm(0)))
  12. #else
  13. #define asmlinkage CPP_ASMLINKAGE
  14. #endif
  15.  
  16. #define SYMBOL_NAME_STR(X) #X
  17. #define SYMBOL_NAME(X) X
  18. #ifdef __STDC__
  19. #define SYMBOL_NAME_LABEL(X) X##:
  20. #else
  21. #define SYMBOL_NAME_LABEL(X) X/**/:
  22. #endif
  23.  
  24. #ifdef __arm__
  25. #define __ALIGN .align 0
  26. #define __ALIGN_STR ".align 0"
  27. #else
  28. #ifdef __mc68000__
  29. #define __ALIGN .align 4
  30. #define __ALIGN_STR ".align 4"
  31. #else
  32. #if !defined(__i486__) && !defined(__i586__)
  33. #define __ALIGN .align 4,0x90
  34. #define __ALIGN_STR ".align 4,0x90"
  35. #else  /* __i486__/__i586__ */
  36. #define __ALIGN .align 16,0x90
  37. #define __ALIGN_STR ".align 16,0x90"
  38. #endif /* __i486__/__i586__ */
  39. #endif /* __mc68000__ */
  40. #endif /* __arm__ */
  41.  
  42. #ifdef __ASSEMBLY__
  43.  
  44. #define ALIGN __ALIGN
  45. #define ALIGN_STR __ALIGN_STR
  46.  
  47. #define ENTRY(name) \
  48.   .globl SYMBOL_NAME(name); \
  49.   ALIGN; \
  50.   SYMBOL_NAME_LABEL(name)
  51.  
  52. #endif
  53.  
  54. #endif
  55.